import Mock from "mockjs";
import { setStorage, getStorage } from "../utils/storage";
const Random = Mock.Random;

// 请求拦截
Mock.mock("/users/login", "post", (config) => {
  console.log("config", config);
  const userDb = getStorage("userDb");
  console.log("查询用户：", userDb);

  return {
    code: "200",
    msg: "success",
    data: {
      token: Random.string(), // 随机字符串
    },
  };
});
